#kafka = require('kafka-node')
#HighLevelProducer = kafka.HighLevelProducer
#Client = kafka.Client
#config = require("../config")
#client = new Client(config.services.kafka.zookeeper)
#producer = new HighLevelProducer(client)

#producer.on 'ready',() ->
#  console.log "kafka is ready!!!!"

#producer.on 'error',(err) ->
#  console.log 'error',err


#exports.send = (msg) ->
#  topic = "gfw_edu"
#  msgs = [{topic:topic,messages:[msg]}]
#  producer.send msgs,(err,data) ->


# var kafka = require('');
# var HighLevelProducer = kafka.HighLevelProducer;
# var Client = kafka.Client;
# var client = new Client();
# var argv = require('optimist').argv;
# var topic = argv.topic || 'topic1';
# var count = 10, rets = 0;
# var producer = new HighLevelProducer(client);

# producer.on('ready', function () {
#     setInterval(send, 1000);
# });

# producer.on('error', function (err) {
#     console.log('error', err)
# })

# function send() {
#     var message = new Date().toString();
#     producer.send([
#       {topic: topic, messages: [message] }
#     ], function (err, data) {
#         if (err) console.log(err);
#         else console.log('send %d messages', ++rets);
#         if (rets === count) process.exit();
#     });
# }
